import 'package:flutter/material.dart';
import 'package:klfz_flutter/book/book_read/logic.dart';
import 'battery_view.dart';
import 'package:intl/intl.dart';
import 'package:get/get.dart';
class ReadOverlayer extends StatelessWidget {

  final BookReadLogic logic = Get.put(BookReadLogic());

  @override
  Widget build(BuildContext context) {

    var format = DateFormat('HH:mm');
    var time = format.format(DateTime.now());

    return SafeArea(
      child: Container(
        padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
        child: GetBuilder<BookReadLogic>(
          builder: (logic) {
            return Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text("第${logic.current_chapter}章", style: TextStyle(fontSize: 14, color: Colors.grey)),
                Expanded(child: Container()),
                Row(
                  children: [
                    BatteryView(),
                    SizedBox(width: 10),
                    Text(time, style: TextStyle(fontSize: 11, color: Colors.red)),
                    Expanded(child: Container()),
                    Text("第${logic.current_page}页", style: TextStyle(fontSize: 11, color: Colors.red)),
                  ],
                )
              ],
            );
          },
        )
      ),
    );
  }
}

//




